package com.ruoyi.web.domain;

import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import nonapi.io.github.classgraph.json.Id;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@EqualsAndHashCode(callSuper = true)
@Data
public class GrCard extends BaseEntity {
    @Id
    private Integer id;

    private Integer cardType;

    private String cardName;

    @DecimalMin(value = "0.01", message = "金额必须大于0")
    private BigDecimal amount;

    private Integer orderSort;







    public String getCardTypeName() {
        if (cardType == null) {
            return "";
        }
        switch (cardType) {
            case 1: return "月卡";
            case 2: return "季卡";
            case 3: return "年卡";
            default: return "未知类型";
        }
    }

}